Skip to content

docs: add VHS demo screencast pipeline#109

Open
rominf wants to merge 5 commits into
mainfrom
docs/demo-screencasts
Open

docs: add VHS demo screencast pipeline#109
rominf wants to merge 5 commits into
mainfrom
docs/demo-screencasts

Conversation

@rominf

@rominf rominf commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Automates terminal demo GIFs for the README so they're generated in CI and never committed to source branches.

  • Adds VHS tapes (docs/tapes/) for four demos: version, engines list, services list, and one-shot chat.
  • Adds a demo-gifs workflow that builds the binaries, renders each tape, and publishes GIFs to an orphan media branch (force-pushed → single commit, old blobs GC'd). The README embeds them by absolute raw URL.
  • The server-backed demos (chat, services) reuse this repo's e2e mock OpenAI server through a new standalone rocm-demo-env binary: it boots the mock, plants a managed-service record into an isolated config, and prints the env that points rocm at it. No GPU or real model — renders are deterministic.
  • Factors the service-record schema into a shared write_service_record (used by both the cucumber World and the demo runner) so the two can't drift.
  • The mock's chat reply is overridable via ROCM_MOCK_CHAT_REPLY so screencasts read naturally instead of showing the test-only stub.

Why

The README has no visual of the CLI in action. Purpose-built demos give reviewers and users an at-a-glance feel for chat/services without anyone maintaining hand-recorded GIFs — and without bloating main with binaries.

Triggers

workflow_dispatch + on published release (never on PRs — rendering is slow and would churn the branch). The release tag doubles as an image-cache buster for GitHub's proxy.

Verification

  • rocm + rocm-demo-env build; e2e test target still compiles with the refactored World.
  • End-to-end locally: demo-env.shrocm services list shows the mock service; rocm chat --prompt returns the custom reply; the EXIT trap stops the server (no leak).
  • Actual VHS rendering is exercised by the workflow (VHS isn't installed in the dev env); the tapes only invoke commands verified above.

Dependency / scope

Risk

Low — no product code paths change. The only change to existing test code is extracting a shared helper (behavior-preserving) and an env-gated mock reply that defaults to the current string.

@rominf
rominf force-pushed the docs/demo-screencasts branch 3 times, most recently from 45b5eda to b7a01d8 Compare July 13, 2026 18:50
@fredespi
fredespi force-pushed the test/add-e2e-robot-framework branch from 6d309d7 to 204c4e8 Compare July 15, 2026 12:59
Base automatically changed from test/add-e2e-robot-framework to main July 15, 2026 15:49
@rominf
rominf force-pushed the docs/demo-screencasts branch from b7a01d8 to 804705b Compare July 15, 2026 16:18
rominf added 2 commits July 17, 2026 09:21
Generate terminal demo GIFs for the README from VHS tapes, rendered in
CI and published to an orphan `media` branch so no binaries land in the
source history. The README embeds them by absolute raw URL.

Tapes are pure command sequences; all setup (build dir on PATH, isolated
config, the mock server) is done by docs/tapes/render.sh BEFORE vhs runs.
This is deliberate: VHS types on a fixed clock and never waits for a
command to return, so setup done inside a tape races the typing.

Server-backed demos (chat, services) reuse the e2e harness's mock OpenAI
server via a new standalone `rocm-demo-env` binary: it starts the mock,
plants a managed-service record into an isolated config, and prints the
env that points `rocm` at it — no GPU or real model needed. The record
schema is shared with the cucumber World via `write_service_record` so
the two can't drift. The mock ignores SIGINT/SIGHUP (VHS/ttyd emit some
during terminal setup) and stops on SIGTERM, so it survives until the
tape runs. Its chat reply is overridable via ROCM_MOCK_CHAT_REPLY.

Rendering runs on workflow_dispatch and on release (never on PRs, where
it would be slow and churn the branch); the release tag doubles as an
image-cache buster.

Stacked on #69 (the e2e harness this reuses); keep as draft until it lands.

Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
@rominf
rominf force-pushed the docs/demo-screencasts branch from 760e977 to 5b889ae Compare July 17, 2026 09:31
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Comment thread xtask/src/demos.rs
require_file(&bin_dir.join(binary_name("rocm-demo-env")))?;

let demo_root = unique_demo_root();
std::fs::create_dir_all(&demo_root)
Comment thread xtask/src/demos.rs
}

fn require_file(path: &Path) -> Result<()> {
if !path.is_file() {
rominf added 2 commits July 17, 2026 12:20
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
@rominf
rominf marked this pull request as ready for review July 17, 2026 13:06
@EugeneKSiloAi

Copy link
Copy Markdown
Collaborator

Blocking / must-fix before merge to main

  1. Unpinned actions/checkout@v6 violates the repo's own action-pinning rule.
    - uses: actions/checkout@v6
    AGENTS.md §6 requires pinning actions to a full commit SHA with a trailing # vX.Y.Z comment, never a moving tag. The other two actions in this same file are correctly pinned (setup-rust-toolchain@166cdc… # v1.17.0, peaceiris@84c30a… # v4.1.0), and the dominant convention across ci.yml/release.yml/nightly.yml is actions/checkout@df4cb1c # v6.0.3. Match it here for consistency and supply-chain safety. (There are pre-existing @v6 stragglers elsewhere, but a new file shouldn't add another.)

  2. The temporary feature-branch trigger must be removed before merging.
    branches: [docs/demo-screencasts]
    The inline comment already acknowledges this is scaffolding ("The feature-branch push trigger is temporary"). It's dead weight on main and, combined with the commit eb4edea ci: trigger demo render on feature branch, is exactly the kind of dev-loop churn the OSS workflow (§11: "one logical change") says to clean up. Drop the push: trigger (and squash the scaffolding commits) as part of the pre-merge rebase you noted.

  3. Misleading comment in the "Stage rendered media" step.

demo-gifs.yml
Lines 55-61
      # Publish from an unignored staging directory. `docs/media/*.gif` is
      # intentionally git-ignored on source branches, and the Pages action honors
      # that ignore file while preparing assets.

peaceiris/actions-gh-pages publishes publish_dir (./rendered-media) with force_orphan; it does not consult docs/media/.gitignore. The staging copy is needed precisely because docs/media is git-ignored — the "Pages action honors that ignore file" clause is inaccurate and could mislead a future maintainer. Reword to just explain the staging copy.

  1. Fictitious model id shown in a user-facing demo. Qwen/Qwen3.5-0.6B (in cli.tape, rocm-demo-env.rs, demos.rs) isn't a real model — Qwen3.5 has no 0.6B variant, and it's not in model_catalog.json (which has Qwen/Qwen3.5-4B). It works because the mock advertises whatever it's told, but a reviewer/user watching the GIF may notice. Consider using a real catalog id (e.g. Qwen/Qwen3.5-4B) so the screencast doesn't teach a non-existent model. Purely cosmetic, but it's the visible artifact this PR exists to produce.

Nits (optional)

  • PR description drift. The description says "four demos (version, engines list, services list, one-shot chat)" and per-command tapes; the implementation consolidated to two composite tapes (cli, console). Worth syncing the description so reviewers aren't hunting for four tape files.
  • rocm-demo-env standalone reply. When run directly (as demos.md/demo-env.sh suggests for manual testing), ROCM_MOCK_CHAT_REPLY is unset, so rocm chat returns the test stub rather than the natural reply — only xtask demos sets it. Fine, but the manual-run docs could mention exporting it if you want the realistic reply.
  • README lands with 404 image links until the workflow runs once. Acknowledged inline. Since the release trigger is the first realistic fire, consider a one-time manual workflow_dispatch right after merge so main's README isn't broken in the interim.


jobs:
render:
runs-on: ubuntu-latest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to pin to a version in case version update causes breakage in the future.

@clydehoang1 clydehoang1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can pre-approve assuming the security and quality checks are addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants